package com.woniu.shop.rabibit;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AuditConsumer {
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "queue-audit"),
            exchange = @Exchange(name = "exchange-audit",type = ExchangeTypes.DIRECT),
            key = "queue-audit" + "1"
    ))
    public void handlerMessage(String msg) {
        log.info("收到的审核信息：{}",msg);
    }
}
